package com.example.a12769.myapplication.base.activity
import android.content.Context
import android.os.Bundle
import android.view.Window
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity
import com.example.a12769.myapplication.utils.ui_utils.StatusBarUtil
import android.os.Build
import android.view.View
import com.example.a12769.myapplication.R
import com.example.a12769.myapplication.utils.netutils.NetBroadcastReceiver


abstract class BaseActiviy : RxAppCompatActivity(){
    protected var mcontext: Context? = null
    //静态
    companion object {
        lateinit var evevt: NetBroadcastReceiver.NetEvevt
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE)
        /*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
            StatusBarUtil.setStatusBarColor(this, R.color.white)
        }*/
        super.onCreate(savedInstanceState)
        this.mcontext=this
        setContentView(getLayoutId())
        initView()
        initLisenner()
        initData()


    }

    abstract fun initLisenner()

    abstract fun initData()

    abstract fun getLayoutId(): Int

    /**
     * 初始化view
     * @param view
     * @param savedInstanceState
     */

    protected abstract fun initView()

    override fun onDestroy() {
        super.onDestroy()
    }


}
